assignment2

This is a run through my second assignment

Nora Jones https://example.com/norajones
04-18-2021

Instructions

Include your code in R chunks below, along with a walkthrough explanation in text of what you’re doing when answering the assignment sections below (the text can be either out here in the text portion of the RMarkdown document, or as commented lines within the chunks).

You can break things up into as many separate code chunks as you feel makes sense given the task at hand. Please feel free to make use of the material and code samples we went over in last week’s class to adapt to relevant scenarios below.


Part 1

landmark_data <- read_csv("landmark.csv")
 
leaflet(data=landmark_data) %>% 
  addTiles() %>% 
  addMarkers(~Longitude,~Latitude,label = ~Name) 

Part 2

#import the NYT's covid case data for states
covidcases <- read_csv("https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-states.csv")

#Download the polygon boundaries for states at the lowest resolution using tigris package
states <- tigris::states(cb=T)

  |                                                                  
  |                                                            |   0%
  |                                                                  
  |                                                            |   1%
  |                                                                  
  |=                                                           |   1%
  |                                                                  
  |=                                                           |   2%
  |                                                                  
  |==                                                          |   3%
  |                                                                  
  |==                                                          |   4%
  |                                                                  
  |===                                                         |   4%
  |                                                                  
  |===                                                         |   5%
  |                                                                  
  |====                                                        |   6%
  |                                                                  
  |====                                                        |   7%
  |                                                                  
  |=====                                                       |   9%
  |                                                                  
  |======                                                      |   9%
  |                                                                  
  |======                                                      |  10%
  |                                                                  
  |======                                                      |  11%
  |                                                                  
  |=======                                                     |  11%
  |                                                                  
  |=======                                                     |  12%
  |                                                                  
  |========                                                    |  14%
  |                                                                  
  |=========                                                   |  15%
  |                                                                  
  |=========                                                   |  16%
  |                                                                  
  |==========                                                  |  17%
  |                                                                  
  |===========                                                 |  18%
  |                                                                  
  |===========                                                 |  19%
  |                                                                  
  |============                                                |  20%
  |                                                                  
  |=============                                               |  22%
  |                                                                  
  |==============                                              |  23%
  |                                                                  
  |===============                                             |  25%
  |                                                                  
  |===============                                             |  26%
  |                                                                  
  |================                                            |  26%
  |                                                                  
  |================                                            |  27%
  |                                                                  
  |=================                                           |  28%
  |                                                                  
  |==================                                          |  30%
  |                                                                  
  |===================                                         |  31%
  |                                                                  
  |===================                                         |  32%
  |                                                                  
  |====================                                        |  33%
  |                                                                  
  |=====================                                       |  35%
  |                                                                  
  |======================                                      |  36%
  |                                                                  
  |=======================                                     |  38%
  |                                                                  
  |========================                                    |  39%
  |                                                                  
  |=========================                                   |  42%
  |                                                                  
  |==========================                                  |  43%
  |                                                                  
  |===========================                                 |  44%
  |                                                                  
  |============================                                |  46%
  |                                                                  
  |============================                                |  47%
  |                                                                  
  |=============================                               |  48%
  |                                                                  
  |=============================                               |  49%
  |                                                                  
  |==============================                              |  50%
  |                                                                  
  |===============================                             |  51%
  |                                                                  
  |================================                            |  54%
  |                                                                  
  |==================================                          |  56%
  |                                                                  
  |==================================                          |  57%
  |                                                                  
  |===================================                         |  59%
  |                                                                  
  |====================================                        |  60%
  |                                                                  
  |=====================================                       |  62%
  |                                                                  
  |======================================                      |  63%
  |                                                                  
  |=======================================                     |  65%
  |                                                                  
  |=======================================                     |  66%
  |                                                                  
  |=========================================                   |  68%
  |                                                                  
  |==========================================                  |  69%
  |                                                                  
  |==========================================                  |  70%
  |                                                                  
  |===========================================                 |  72%
  |                                                                  
  |=============================================               |  74%
  |                                                                  
  |=============================================               |  75%
  |                                                                  
  |==============================================              |  76%
  |                                                                  
  |==============================================              |  77%
  |                                                                  
  |===============================================             |  78%
  |                                                                  
  |================================================            |  80%
  |                                                                  
  |=================================================           |  81%
  |                                                                  
  |=================================================           |  82%
  |                                                                  
  |==================================================          |  83%
  |                                                                  
  |===================================================         |  84%
  |                                                                  
  |===================================================         |  85%
  |                                                                  
  |====================================================        |  86%
  |                                                                  
  |=====================================================       |  88%
  |                                                                  
  |=====================================================       |  89%
  |                                                                  
  |======================================================      |  89%
  |                                                                  
  |=======================================================     |  91%
  |                                                                  
  |========================================================    |  93%
  |                                                                  
  |============================================================| 100%
feb22 <- covidcases %>%
  filter(date==mdy("2/22/21")) 
states2 <- states %>% 
    inner_join(feb22,by=c("NAME"="state"))

  

palette <- colorBin("YlOrRd",domain = states2$deaths)
leaflet(states2) %>% 
  addPolygons(
    fillColor = ~palette(deaths)
    
    
  )

Part 3

#your code here

sac_sales <- read_csv("https://support.spatialkey.com/wp-content/uploads/2021/02/Sacramentorealestatetransactions.csv")


residential_sales <- sac_sales %>% 
  filter(type=="Residential")

leaflet(residential_sales) %>% 
  addTiles() %>% 
  addCircleMarkers(
    lng = ~longitude,
    lat = ~latitude,
    radius = ~price,
    
    
  )

```{.r .distill-force-highlighting-css}